/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package core.messages.server.inGame;
import core.messages.Msg_One;
import cstAndEnum.SKILL_TYPE;
import models.CastInfo;

/**
 * 服务端发送，可以回应的消息
 * @author Invince
 */
public class Msg_Response_Accept extends Msg_One{
/*----------Attributs-------------------*/
    /**
     * Skill的id
     */
    protected int idSkill;
    /**
     * 自己的id
     */
    protected int idSource;
    /**
     * 对象的id
     */
    protected int[] idTargetPlayers;
    /**
     * 卡片的id
     */
    protected int idCard;
    /**
     * 回应所搭上的牌的id，比如回应吕布的决斗，得用两张杀，其中一张应该摆在这里
     */
    protected int[] idTargetCards;
    /**
     * 表示是否是主公技
     */
    protected SKILL_TYPE skillType;
    
/*----------Public functions------------*/
/*----------Private functions-----------*/
/*----------Constructor-----------------*/
    public Msg_Response_Accept(String sender, String receiver,int idSkill, int idSource, int[] idTargetPlayers, int idCard, int[] idTargetCards,SKILL_TYPE skillType) {
        super(sender,receiver);
        this.idSkill = idSkill;
        this.idSource = idSource;
        this.idTargetPlayers = idTargetPlayers;
        this.idCard = idCard;
        this.skillType = skillType;
        this.idTargetCards=idTargetCards;
    }

    public Msg_Response_Accept(String sender,String receiver,CastInfo castInfo){
        super(sender, receiver);
        this.idSkill=castInfo.getSkill().getId();
        this.idSource=castInfo.getSource().getId();
        this.idTargetPlayers = null;
        for(int i=0;i<castInfo.getTargetPlayers().size();i++){
            this.idTargetPlayers[i]=castInfo.getTargetPlayers().get(i).getId();
        }
        this.idCard=castInfo.getCard().getId();
        this.idTargetCards = null;
        for(int i=0;i<castInfo.getTargetCards().size();i++){
            this.idTargetCards[i]=castInfo.getTargetCards().get(i).getId();
        }
        this.skillType=castInfo.getSkillType();
    }

/*----------Gets and sets---------------*/
    public int getIdCard() {
        return idCard;
    }

    public void setIdCard(int idCard) {
        this.idCard = idCard;
    }

    public int getIdSkill() {
        return idSkill;
    }

    public void setIdSkill(int idSkill) {
        this.idSkill = idSkill;
    }

    public int getIdSource() {
        return idSource;
    }

    public void setIdSource(int idSource) {
        this.idSource = idSource;
    }

    public int[] getIdTargetPlayers() {
        return idTargetPlayers;
    }

    public void setIdTargetPlayers(int[] idTargetPlayers) {
        this.idTargetPlayers = idTargetPlayers;
    }

    public SKILL_TYPE getSkillType() {
        return skillType;
    }

    public void setSkillType(SKILL_TYPE skillType) {
        this.skillType = skillType;
    }

    public int[] getIdTargetCards() {
        return idTargetCards;
    }

    public void setIdTargetCards(int[] idTargetCards) {
        this.idTargetCards = idTargetCards;
    }
    
}
